package io.kubesphere.devops.core;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.LinkedHashMap;
import java.util.Map;

@Data
@Configuration
@ConfigurationProperties(prefix = MultipleDataSourceProperties.PREFIX)
public class MultipleDataSourceProperties {
    public static final String PREFIX = "abacus";

    private Map<String, DataSourceProperty> datasource = new LinkedHashMap<>();

    public DataSourceProperty getMaster() {
        return datasource.get("master");
    }

    public DataSourceProperty getDataSourceProperty(String key) {
        return datasource.get(key);
    }

}
